home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / c / sozobon / sozbin15.zoo / sozdistr / doc / binary.doc / hcc.man < prev    next >
Encoding:
Text File  |  1995-10-01  |  11.5 KB  |  310 lines

  1. HCC(1)                  User Commands                           HCC(1)
  2.  
  3. NAME
  4.  
  5.         hcc   -  Hans' C compiler - the SOZOBON(X) compiler
  6.  
  7. SYNOPSIS            
  8.  
  9.         hcc [options] file [ file ... ]
  10.  
  11.         hcc [options] <inputfile> [<outputfile> [<errorfile>]]
  12.  
  13.         hcc [options] --inputfiles <inputfile> <inputfile> ...
  14.  
  15.         hcc [-VvhPNSLTQ] [-M<n>] [-I<path>] [-D<sym>[=<val>]] [-U<sym>]
  16.             [-W{all|{+|-}{PTR|CMP|DIF|PMR|RDF|BRV|CUS|IFD|NPR}}] [-O<file>]
  17.             [-E<file>][-X<n>[<func>]] <file> [<file> ...]
  18.  
  19.  
  20. DESCRIPTION            
  21.  
  22.       The hcc command accepts C source files and generates assembly language
  23.       output to the corresponding '.s' files.  The pre-processor and all
  24.       phases of the compiler are included within this program. 
  25.  
  26.       There are different ways to specify the filenames with different
  27.       results: After the '--inputfiles' option you can specify a list of
  28.       inputfiles to compile. This may be usefull to get a list of all errors
  29.       and no output, e.g.:
  30.           hcc -O\dev\null -Eallmsgs --inputfiles file1.c file2.c ...
  31.  
  32.       The usual way to handle arguments now is the same as top and jas
  33.       handle it:
  34.           hcc <options> <inputfile> <outputfile> <errorfile>
  35.  
  36.       After the '<errorfile>' you can specify more <inputfile> <outputfile>
  37.       pairs, with new <options> between the pairs. This goes not for top and
  38.       jas. So the synopsis would be correctly:
  39.  
  40.       hcc [<options>] <infile> [<outfile> [<errfile> 
  41.                         [[<options>] <infile> <outfile>]... ]]
  42.       and:
  43.  
  44.       hcc [options] --inputfiles <inputfile> [[options] <inputfile>]...
  45.  
  46.       Of course there is a third way, mixing up these both schemes:
  47.       
  48.       hcc [options] <infile> [<outfile> [<errfile>]] 
  49.                        --inputfiles <inpfile> [[options] <inpfile>]...
  50.  
  51.       This seems all a little bit complicated, but it isn't at all.
  52.       The most of it are features, I didn't plan.
  53.  
  54.  
  55.       You can specify '-' as <inputfile>, hcc will read from stdin than,
  56.       and specify '-' as <outputfile> or <errorfile>, output goes to
  57.       stdout. With no files specified hcc reads from stdin and writes
  58.       to stdout. 
  59.  
  60.  
  61.       The following options are accepted by hcc: 
  62.  
  63.         --version
  64.         -V      (Version)
  65.            Print version information to stdout and exit.
  66.  
  67.         -v      (verbose)
  68.            Display a short version info and include filenames to stderr.
  69.            And though an error file is written, print the messages to
  70.            stderr, too.
  71.  
  72.         -h      (help)
  73.            Print a short info about commandline options.
  74.  
  75.         -N      (nested)
  76.            Allow nested comments.
  77.  
  78.         -M<n>   (Messages)
  79.            Stop compiling after <n> warning/error messages.
  80.  
  81.         -L      (Long)
  82.            Make 'int' a long type (32 Bits). Default an int is a short
  83.            integer, and __MSHORT__ is defined.
  84.            (this option is buggy, and not even tested)
  85.  
  86.         -S      (Strings)
  87.            Do not merge strings.
  88.  
  89.         -Q      (Quick)
  90.            Prefer generating of faster code to shorter code.
  91.  
  92.         -P      (Profiling)
  93.           Instructs  the compiler to generate modified function
  94.           entry  code that will call a function 
  95.                 'void _prolog(char funcname[])'
  96.           to count the number of calls to each function. And generate
  97.           a function call of
  98.                 'void _epilog(char funcname[])'
  99.           To time the called function. You have to call function 
  100.                 'void _saveprof()'
  101.           in the program on exit or use the prof_s.o startup code.
  102.           (see Sozobon.Doc for more details)
  103.  
  104.         -T      (Traps)
  105.           Disable trap generation. By default hcc generates the trap
  106.           instructions for OS calls whenever a OS call is identified.
  107.  
  108.         -I<path>
  109.           Include  <path>  in  the  list  of  directories  to  be
  110.           searched for header files (e.g. "-I\usr\include\myheader").  
  111.  
  112.         -D<name>
  113.         -D<name>=<value>
  114.           Define  the  pre-processor macro <name>. If no value is
  115.           given the macro is defined as 1.  
  116.  
  117.         -U<name> 
  118.           Un-define one of the built-in macros.  
  119.  
  120.         -X<n>[<function>]       (Sorce Level Debugging Option)
  121.           Instructs the compiler to generate some code for saving the
  122.           line number for each source code line, and the module name
  123.           for each function call.  You will have to link a special
  124.           module with his option, that tells you with which source 
  125.           code line and module an exception occured (cc will do this
  126.           for you with this option).
  127.           If you specify a function <function> for source level debugging,
  128.           ('_debug' exists therefore in the library) you can tell hcc to
  129.           call this function on every line of soucecode (level <n> = 2) or
  130.           just at begin of every function and in some loops (level <n> = 1).
  131.           (see Sozobon.Doc for more details)
  132.  
  133.         -O<file>
  134.           Write output to file <file>.
  135.  
  136.         -E<file>
  137.           Write error output (messages, warnings) to file <file>.
  138.  
  139.         -F[no-]double-reg-vars
  140.           Put (do not) double vars declared register into regs.
  141.           Default is on.
  142.  
  143.         -F[no-]float-args
  144.           Pass (do not) float values as floats.
  145.           Default is off, pass float args as doubles.
  146.  
  147.         -F[no-]frame-relative
  148.           Generate A6 relative function exit code for all input files.
  149.           Default is off.
  150.           This flag is activated by hcc itself for the current
  151.           function if a call to alloca() is detected, or by the 
  152.           '#pragma' statement "FRL" for current and following functions.
  153.  
  154.         -F[no-]proto
  155.           Use function prototypes, check args and make implied casts.
  156.           Default is on.
  157.           This flag is also accessible via the '#pragma' statement "NPR"
  158.  
  159.         -F[no-]size-t-long
  160.           Change return type of sizeof operator to "unsigned long".
  161.           Default is "unsigned int".
  162.           
  163.         -Wall
  164.           switch on all warning messages and inhibit switching them off
  165.           with #pragma statements in source text.
  166.  
  167.         -W{+|-}<OPT>
  168.           switch on or off printing of warning messages:
  169.                 PTR     pointer types mismatch (default on)
  170.                 CMP     cmp of diff ptrs (default on)
  171.                 DIF     diff ptrs (default on)
  172.                 RDF     redefined macro (default on)
  173.                 PUN     undef of undefined macro (default on)
  174.                 PMR     probably missinig return (default off)
  175.                 BRV     bad return value/type (default on)
  176.                 CUS     comparing unsigned and signed types (default on)
  177.                 IFD     implicit declarate function (default off)
  178.                 NPR     function call w/o prototype
  179.  
  180.         --inputfiles
  181.           All arguments following are inputfiles, except the ones
  182.           prefixed with a '-'. If not already defined, the <outputfile>
  183.           and the <errorfile> are not taken from the argument list,
  184.           except by the options '-O' and '-E'.
  185.  
  186.  
  187.  
  188.         Handling of include/header files / ipc
  189.  
  190.         (some text is missing here)
  191.         If an '*.pre' file exists it is included, if it's timestamp is
  192.         newer then the original filename. If the original file's timestamp
  193.         is younger, a message is printed.
  194.  
  195.  
  196.         The Builtin Prepocessor
  197.  
  198.         It doesn't know to handle the '#elif' statement. Compile
  199.         with cc's '+P' option if it is in your source code.
  200.  
  201.         Macros
  202.  
  203.         Several  macros  are  normally  pre-defined. These are just
  204.         int values, and you can '#undef' them:
  205.         simply TRUE (1) are
  206.                 MC68000, mc68000, ATARI_ST, 
  207.                 TOS, __TOS__,
  208.         a significant int value (BCD) have:
  209.                 SOZOBON         val: (0x200),
  210.                 __SOZOBONX__    val: (0x200 + X version level)
  211.  
  212.         __STDC__   set to val 0 if prototypes are checked, else undefined
  213.         __MSHORT__ (TRUE if -L option was not given, ints are shorts)
  214.  
  215.         Some macros you can't touch with usual cpp statements:
  216.         __BASE_FILE__, __FILE__, __LINE__, 
  217.         __TIME__, __DATE__, __VERSION__,
  218.         __SDATE__, __STIME__, __GDATE__
  219.         But you can use them in your source code.
  220.  
  221.         The following strings are unchange-able at all:
  222.         __BASE_FILE__   (the name of the input file)
  223.         __TIME__        (compile time string hh:mm:ss)
  224.         __DATE__        (compile date string 'Mmm dd yyyy')
  225.         __SDATE__       (compile date string, short format: YY/MM/DD)
  226.         __STIME__       (compile time string, short format hh:mm)
  227.         __GDATE__       (compile date string, german format: DD.MM.YY)
  228.         __VERSION__     (compiler identification string: e.g.:
  229.                                 "SOZOBONx hcc V2.00x16")
  230.         The macros
  231.         __FILE__        (string, current file - maybe a included one)
  232.         __LINE__        (int, line number in current file)
  233.         can be changed by using the cpp statement
  234.         #line <lineno> ["<filename>"]
  235.         An external cpp will generate those statements in it's output
  236.         file to make the compiler print the real input filenames and
  237.         line numbers in error messages.
  238.  
  239.  
  240.         Known '#pragma' statements
  241.  
  242.         #pragma echo [anything]
  243.                 prints the rest of the line to stderr
  244.  
  245.         #pragma OPT "<string>" prints <string> in outputfile,
  246.                 format: ';opt <string>'
  247.                 For top/jas commands/options; You can pass a option
  248.                 string to top to switch top's optimizing switches.
  249.                 (see top.man)
  250.  
  251.         #pragma {+|-}<option>
  252.         Switch the compiler option <option> on '+' or off '-'.
  253.         print warnings?:
  254.                 PTR     pointer types mismatch
  255.                 CMP     cmp of diff ptrs
  256.                 DIF     diff ptrs
  257.                 RDF     redefined symbols
  258.                 PMR     probably missinig return
  259.                 BRV     bad return value/type
  260.                 CUS     comparing unsigned and signed types
  261.                 IFD     implicit declarate function
  262.                 NPR     function call w/o prototype
  263.         code generating options:
  264.                 STR     concat strings?
  265.                 PRO     Profiling  (cmdln '-P'
  266.                 FST     Quick-Flag (cmdln '-Q')
  267.                 TOP     switch off/on Optimizer for this function
  268.                 FRL     generate A6 relative function exit code
  269.                           this function (cmdln '-fframe-relative'
  270.                           for whole file)
  271.                 PTY     use function prototypes
  272.  
  273. ENVIRONMENT
  274.  
  275.         INCLUDEDIR      path to reset default include dir path
  276.                         ("\usr\include", where dir 'xdlibs' is expected)
  277.                         A pathlist is generated from this variable, like:
  278.                         \usr\include\xdlibs,\usr\include
  279.  
  280.         INCLUDE         list of pathes where include files can be found
  281.  
  282.         Directories listed in the "INCLUDE" environment variable 
  283.         replace the builtin ones. $INCLUDEDIR is ignored if $INCLDUE
  284.         is set. cc always generates a $INCLDUE variable if $INCLUDEDIR is
  285.         set. C-Desk will generate a $INCLDUE variable from the selected
  286.         header file pathes, I think.
  287.  
  288.  
  289.         STDERR
  290.  
  291.  
  292. COPYRIGHT
  293.  
  294.         hcc V2.00 Copyright (c) 1988-1992 by Sozobon, Ltd.
  295.         for eXtended Version by C. Wempe & H. Weets, 
  296.         and J. Geiger 1992-1994
  297.  
  298.  
  299. BUGREPORTS
  300.  
  301.         Maintainer is now Volker Seebode. Please send bugreports using
  302.         the 'bugform' to:
  303.         seebode@plesnik.bonsai.de (Volker Seebode)
  304.         or in MausNet:
  305.         Volker Seebode @ AC3 
  306.  
  307. SEE ALSO
  308.  
  309.         cc(1), cpp(1), ipc(1)
  310.